#ifndef WINDOWPROXY_H
#define WINDOWPROXY_H

#include <defs/global.h>
#include <QtCore>
#include <QtGui>

namespace Gui{

    O_PRIVATE_DECLARE(WindowProxy);
    class WindowProxy : public QGraphicsProxyWidget {
        Q_OBJECT
    public:
        WindowProxy(QGraphicsItem *parent = 0, Qt::WindowFlags flag = 0);
        ~WindowProxy();

        QRectF boundingRect()const;
        void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    protected:
        void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
        void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
        bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
        QVariant itemChange(GraphicsItemChange change, const QVariant &value);

    private slots:
        void updateStep(qreal step);
        void stateChanged(QTimeLine::State);
        void hoverIn();
        void hoverOut();

    private:
        O_PRIVATE_DECLARE_MEMBER(WindowProxy);
    };

}
#endif // WINDOWPROXY_H

